#pragma once
#ifndef MATH_H
#define MATH_H

#include <math.h>

struct Vector
{
public:
	float X;
	float Y;
	Vector(float x = 0, float y = 0) : X(x), Y(y) {};
	~Vector() {};

	inline static Vector Add(const Vector& a, const Vector& b) 
	{ return Vector(a.X + b.X, a.Y + b.Y); };

	inline static Vector Subtract(const Vector& a, const Vector& b) 
	{ return Vector(a.X - b.X, a.Y - b.Y); };

	inline static Vector Multiply(const Vector& a, const Vector& b) 
	{ return Vector(a.X * b.X, a.Y * b.Y); };

	inline static Vector Divide(const Vector& a, const Vector& b) 
	{ return Vector(a.X / b.X, a.Y / b.Y); };
	
	inline static float CrossProduct(const Vector& a, const Vector& b)
	{ return a.X * b.Y + a.Y * b.X; }

	inline static float Dot(const Vector& a, const Vector& b) 
	{ return a.X * b.X + a.Y * b.Y; };

	inline static float Length(const Vector& a) 
	{ return sqrt(a.X * a.X + a.Y * a.Y); };

	inline static Vector Normalize(const Vector& a)
	{
		float length = Length(a);
		return Vector(a.X/length, a.Y/length);
	};

	inline Vector Vector::operator +(const Vector& b) { return Add(*this, b); };

	inline Vector Vector::operator -(const Vector& b) { return Subtract(*this, b); };

	inline Vector Vector::operator *(const Vector& b) { return Multiply(*this, b); };

	inline Vector Vector::operator /(const Vector& b) { return Divide(*this, b); }

private:

};

#endif